# 作者：20242321汤泽鹏
# 地点：电科院
# 时间：4 a.m
# 代理地址：Los Angels

import math
def Csum(num1, num2):
    return num1 + num2
def Csub(num1, num2):
    return num1 - num2
def Cmulti(num1, num2):
    return num1 * num2
def CDiv(num1, num2):
    if num2 == 0:
        print("除数不能为0")
        return 0
    return num1 / num2
def logab(a,b):
    return math.log(a,b)
def powab(a,b):
    return math.pow(a,b)
def sqrta(a):
    return math.sqrt(a)
def sina(a):
    return math.sin(a)
def cosa(a):
    return math.cos(a)
def tana(a):
    return math.tan(a)

print(''' 计算器程序
# -------------------------------
# 免责声明：
# 1. 本计算器软件仅供个人使用，开发者对软件使用中的任何损失、故障或不准确性不承担责任。
# 2. 在使用本软件时，请务必核对计算结果，开发者不保证任何由使用本软件而产生的决策准确性。
# 3. 本软件不适用于用于医疗、财务、法律等专业领域，用户应根据专业人士的建议作出决策。

# 版权声明：
# 本软件版权归[走于暗巷]所有，未经授权禁止复制、修改、分发本软件的任何部分。

# -------------------------------
# 开始计算器程序
'''
)

flag = True
while flag:
    choice = input("请输入运算符（+-*/ log pow sqrt sin cos tan）：")
    choice0 = input("复数运算输入(1),整数运算输入(2),浮点数运算输入(3)\n")
    if choice0 == "1":
        num1 = complex(input("请输入一个数："))
        if choice not in ['sqrt','sin','cos','tan']:
            num2 = complex(input("请输入另一个数："))
    elif choice0 == "2":
        num1 = int(input("请输入一个数："))
        if choice not in ['sqrt','sin','cos','tan']:
            num2 = int(input("请输入另一个数："))
    elif choice0 == "3":
        num1 = float(input("请输入一个数"))
        if choice not in ['sqrt','sin','cos','tan']:
            num2 = float(input("请输入另一个数"))
    if choice == "+":
        print("num1 ",choice, " num2 = ", Csum(num1, num2))
    elif choice == "-":
        print("num1 ",choice, " num2 = ", Csub(num1, num2))
    elif choice == "*":
        print("num1 ",choice, " num2 = ", Cmulti(num1, num2))
    elif choice == "/":
        print("num1 ",choice, " num2 = ", CDiv(num1, num2))
    elif choice == "log":
        print("log以",num2,"为底",num1, "的对数 = ", logab(num1, num2))
    elif choice == "pow":
        print("num1 ",choice, " num2 = ", powab(num1, num2))
    elif choice == "sqrt":
        print(choice,"num1 ""= ", sqrta(num1))
    elif choice == "sin":
        print(choice,"num1 ""= ", sina(num1))
    elif choice == "cos":
        print(choice,"num1 ""=", cosa(num1))
    elif choice == "tan":
        print(choice,"num1 ""=", tana(num1))


    conti = input("是否继续？Y/n\n")
    if conti in ["Y","y"]:
        flag = True
    else:
        flag = False
print("感谢使用本计算器，再见！")
